/**
 * 
 */
package org.rollinitiative.d20.entity.races;

import java.util.ArrayList;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;

import org.rollinitiative.d20.entity.AbilityModifier;
import org.rollinitiative.d20.entity.talents.SkillTraining;

/**
 * @author bebopjmm
 * 
 */
@XmlType(name = "RacialLevelType", namespace = "java:org.rollinitiative.d20.entity")
public class RacialLevel
{

   private int level = 0;

   @XmlElement(name = "AbilityModifier")
   private ArrayList<AbilityModifier> abilModList = new ArrayList<AbilityModifier>();

   private AbilityModifierChoice abilModChoice;

   @XmlElement(name = "SkillBonus")
   private ArrayList<SkillTraining> skillList = new ArrayList<SkillTraining>();

   private CombatSpec combatMods = new CombatSpec();


   /**
    * @return the level
    */
   public int getLevel()
   {
      return level;
   }


   /**
    * @param level the level to set
    */
   @XmlAttribute(required = true)
   public void setLevel(int level)
   {
      this.level = level;
   }


   /**
    * @return the combatMods
    */
   public CombatSpec getCombatMods()
   {
      return combatMods;
   }


   /**
    * @param combatMods the combatMods to set
    */
   @XmlElement(name = "CombatMods", required = true)
   public void setCombatMods(CombatSpec combatMods)
   {
      this.combatMods = combatMods;
   }


   /**
    * @return the abilModChoice
    */
   public AbilityModifierChoice getAbilModChoice()
   {
      return abilModChoice;
   }


   /**
    * @param abilModChoice the abilModChoice to set
    */
   @XmlElement(name = "AbilityModifierChoice", required = false)
   public void setAbilModChoice(AbilityModifierChoice abilModChoice)
   {
      this.abilModChoice = abilModChoice;
   }


   public AbilityModifier[] getAbilityModifiers()
   {
      return abilModList.toArray(new AbilityModifier[abilModList.size()]);
   }


   public SkillTraining[] getSkillBonuses()
   {
      return skillList.toArray(new SkillTraining[skillList.size()]);
   }

   @XmlType(name = "RacialCombatType", namespace = "java:org.rollinitiative.d20.entity")
   public static class CombatSpec
   {
      private int naturalArmor = 0;

      private int racialBAB = 0;


      /**
       * @return the naturalArmor
       */
      public int getNaturalArmor()
      {
         return naturalArmor;
      }


      /**
       * @param naturalArmor the naturalArmor to set
       */
      @XmlAttribute(required = true)
      public void setNaturalArmor(int naturalArmor)
      {
         this.naturalArmor = naturalArmor;
      }


      /**
       * @return the racialBAB
       */
      public int getRacialBAB()
      {
         return racialBAB;
      }


      /**
       * @param racialBAB the racialBAB to set
       */
      @XmlAttribute(required = true)
      public void setRacialBAB(int racialBAB)
      {
         this.racialBAB = racialBAB;
      }

   }

   @XmlType(name = "AbilityModifierChoiceType", namespace = "java:org.rollinitiative.d20.entity")
   public static class AbilityModifierChoice
   {
      private int modifier = 0;

      private QName id;


      /**
       * @return the modifier
       */
      public int getModifier()
      {
         return modifier;
      }


      /**
       * @param modifier the modifier to set
       */
      @XmlAttribute(name = "modifier", required = true)
      public void setModifier(int modifier)
      {
         this.modifier = modifier;
      }


      /**
       * @return the id
       */
      public QName getId()
      {
         return id;
      }


      /**
       * @param id the id to set
       */
      @XmlAttribute(name = "id", required = true)
      public void setId(QName id)
      {
         this.id = id;
      }

   }
}
